<?php
use yii\helpers\Url;
?>
<div class="row">
<div class="col-lg-12">
    <table class="table table-striped">
        <thead>
        <tr>
            <th>商品ID</th>
            <th>商品名字</th>
            <th>商品价格</th>
            <th>商品图片</th>
            <th>商品文章</th>
            <th>热销</th>
            <th>推荐</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($lists as $key => $value) {?>
            <tr>
                <th scope="row"><?=$value['id']?></th>
                <td><?=$value['name']?></td>
                <td><?=$value['price']?></td>
                <td><img src="<?=Yii::$app->imagemanager->getImagePath($value['image_id'], '160', '160',false);?>"></td>
                <td><?=$value['article_id']?></td>
                <td>
                    <?php
                    if($value['is_hot']==0){?>
                        <span style="color: red;">否</span>
                    <?php }elseif($value['status']==1){ ?>
                        <span style="color: green">是</span>
                    <?php }?>
                </td>
                <td>
                    <?php
                    if($value['is_advise']==0){?>
                        <span style="color: red;">否</span>
                    <?php }elseif($value['status']==1){ ?>
                        <span style="color: green">是</span>
                    <?php }?>
                </td>
                <td>
                    <a href="<?=Url::to(['/frontend/goods/view', 'id' => $value['id'], 'value' => 1])?>" class="btn btn-info">查看</a>
                    <a href="<?=Url::to(['goods/create', 'id' => $value['id']])?>" class="btn btn-warning">修改</a>
                    <a href="<?=Url::to(['goods/del', 'id' => $value['id']])?>" class="btn btn-danger">删除</a>
                    <a href="<?=Url::to(['goods/format', 'id' => $value['id']])?>" class="btn btn-warning">规格</a>
                </td>
            </tr>
        <?php }?>
        </tbody>
    </table>
</div>
</div>
